package Demo01;

abstract class shape{
    protected abstract void draw();

    public void func(){
        System.out.println("hehe");
    }
}

class rect extends shape {
    @Override
    public void draw(){
        System.out.println("画矩形！！");
    }
}

//abstract class rect extends shape{
//
//}
//class A extends rect{
//    @Override
//    public void draw(){
//        System.out.println("画矩形！！！");
//    }
//}

class cycle extends shape{
    @Override
    public void draw(){
        System.out.println("画圆！！！");
    }
}

class flower extends shape{
    @Override
    public void draw(){
        System.out.println("*！！！");
    }
}

public class test {
    public static void drawmap(shape s){
        s.draw();
    }

    public static void main(String[] args) {
        drawmap(new rect());
        drawmap(new cycle());
        drawmap(new flower());
    }
}
